home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / recent / iib122.lha / IIB / Threads / Additional / IARexx.lha / jitter.irx < prev    next >
Text File  |  1997-05-19  |  3KB  |  102 lines

  1. /*
  2. **  $VER: Jitter.irx 0.03 (14 May 1997)  **
  3. **
  4. **      (c) 1997 Ernesto Poveda Cortes
  5. **
  6. **  PROGRAMNAME:
  7. **      Jitter.irx
  8. **
  9. **  FUNCTION:
  10. **      Makes an object to jitter its points.
  11. **
  12. **  $HISTORY:
  13. **
  14. **  14 May 1997 :  0.03 :  Working version...
  15. **  14 May 1997 :  0.01 : initial release
  16. */
  17.  
  18.  
  19.  
  20. OPTIONS RESULTS                             /* enable return codes     */
  21. ADDRESS 'Imagine.1'
  22.  
  23. OPTIONS FAILAT 6                            /* ignore warnings         */
  24. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  25.  
  26. NL = '0A'x
  27. /* ------------------------------------------------------------------- */
  28.  
  29. IMAGINETOFRONT
  30.  
  31. IF ~EXISTS('LIBS:rexxreqtools.library') THEN DO
  32.    NOTIFY 'Please install the rexxreqtools.library into your LIBS: directory'
  33.    NOTIFY 'It is available from /pub/aminet/util/rexx/RexxReqTools.lha'
  34.    exit
  35. END
  36. CALL ADDLIB('rexxreqtools.library',0,-30,0)
  37.  
  38. IF ~EXISTS('LIBS:rexxmathlib.library') THEN DO
  39.   CALL rtezrequest('Please install the rexxmathlib.library into your LIBS: directory' || NL || NL ||,
  40.                    'The library is available from pub/aminet/util/rexx/RexxMathLib1.3.lha','Great, thanks!','Go get RexxMathLib.library','rt_reqpos = reqpos_centerscr')
  41.   exit
  42. END
  43. CALL ADDLIB('rexxmathlib.library',0,-30,0)
  44.  
  45. displayrexxptr ON
  46.  
  47. call rtezrequest("Jitter.irx -  1997 Ernie",'_Good|_Exit','U have launched...','rt_reqpos = reqpos_centerscr')
  48. if ~rtresult then call BYE
  49.  
  50. /* why w instead of x?? well, REXX does not like to use x as variable...*/
  51. w = rtgetlong(0,'Enter X value','X = ',,'rt_reqpos = reqpos_centerscr')
  52. if ~rtresult then call BYE
  53. y = rtgetlong(0,'Enter Y value','Y = ',,'rt_reqpos = reqpos_centerscr')
  54. if ~rtresult then call BYE
  55. z = rtgetlong(0,'Enter Z value','Z = ',,'rt_reqpos = reqpos_centerscr')
  56. if ~rtresult then call BYE
  57.  
  58. if ((w==0) & (z==0) & (y==0)) then do
  59.   call rtezrequest("X=0, Y=0 , Z=0 ??"||NL||"You Must use at least a non zero value",'_Oops','Problem:','rt_reqpos = reqpos_centerscr')
  60.   call BYE
  61. end
  62.  
  63. smooth = 0
  64.  
  65. call rtezrequest('Wanna Smooth it?','_Yes|_No','Maybe...','rt_reqpos = reqpos_centerscr')
  66. if rtresult then do
  67.   smooth = rtgetlong(5,'Enter Smooth value','Smoothing',,'rt_reqpos = reqpos_centerscr')
  68. end
  69.  
  70. /* ------------------------------------------------------------------- */
  71. transform_translate 0 0 0 /* This will make the undo works :-) */
  72. getgeometry
  73. getaxisinfo
  74.  
  75. /* Diferent calls, diferent objects ...*/
  76. random(,,time(s))
  77.  
  78. do i= 1 to pnt_num
  79.    if w>0 then pnt_x.i = pnt_x.i+ random(0,w)
  80.    if y>0 then pnt_y.i = pnt_y.i+ random(0,y)
  81.    if z>0 then pnt_z.i = pnt_z.i+ random(0,z)
  82. end
  83.  
  84. setgeometry
  85.  
  86. if (smooth>0) then smoothingtoollock smooth
  87.  
  88. /* ------------------------------------------------------------------- */
  89.  
  90. BYE:
  91. ActivateImagine
  92. displayrexxptr OFF
  93. EXIT
  94.  
  95. SYNTAX:
  96.  
  97. notify "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  98. ActivateImagine
  99. displayrexxptr OFF
  100. EXIT
  101.  
  102.